﻿@* @page "/" *@
@page "/home"
@inject AuthenticationStateProvider customAuthenticationStateProvider
<PageTitle>Home</PageTitle>

<h1> 欢迎使用：@username</h1>
@code   {
 private string username;
    protected override async Task OnInitializedAsync()
    {
        var authState = await customAuthenticationStateProvider.GetAuthenticationStateAsync();
        var user = authState.User;
        username = user.Identity.Name;
    }
}